<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        for(var m=10000;m<=99999;m++){
            var n=parseInt(m/10000)%10;
            var o=parseInt(m/1000)%10;
            var q=parseInt(m/10)%10;
            var r=m%10;
            if(n==r&&o==q){
                console.log(m);
            }
        }
    </script>
</body>
</html>